package com.smedi.ismedi.personnel.core.domain.aggregatemodel.impl;

import com.smedi.ismedi.personnel.core.application.query.SubOrganizationSyncQueryService;
import com.smedi.ismedi.personnel.core.application.query.vo.SubOrganizationSyncFromImisVo;
import com.smedi.ismedi.personnel.core.domain.repository.SubOrganizationSyncFromImisRepository;
import com.smedi.ismedi.web.starter.util.DozerUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xulinjun
 * @Date: 2021-8-2 14:24
 */
@Slf4j
@Service
@AllArgsConstructor
public class SubOrganizationSyncQueryServiceImpl implements SubOrganizationSyncQueryService {
    private final DozerUtil dozerUtil;

    private final SubOrganizationSyncFromImisRepository subOrganizationSyncFromImisRepository;

    @Override
    public List<SubOrganizationSyncFromImisVo> queryList() {
        return dozerUtil.convertor(subOrganizationSyncFromImisRepository.selectAll(), SubOrganizationSyncFromImisVo.class);
    }
}
